package com.bw.module_video_detail.test_gl_surfaceview
import android.opengl.GLES20
import android.opengl.GLSurfaceView
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import com.bw.module_video_detail.R
import javax.microedition.khronos.egl.EGLConfig
import javax.microedition.khronos.opengles.GL10

class GLSurfaceViewActivity : AppCompatActivity() {
    private lateinit var glSurfaceView: GLSurfaceView
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_glsurface_view)
        glSurfaceView = findViewById(R.id.gl_surface_view)
        //设置版本
        glSurfaceView.setEGLContextClientVersion(2)
        //设置渲染器
        glSurfaceView.setRenderer(CubeRenderer(this))
        //设置渲染模式 RENDERMODE_CONTINUOUSLY:渲染每一帧 RENDERMODE_WHEN_DIRTY:不一样才渲染
        glSurfaceView.renderMode = GLSurfaceView.RENDERMODE_CONTINUOUSLY
    }
}